{% import "bootstrap/wtf.html" as wtf %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CMS登录界面</title>
    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">


    <!-- Custom styles for this template -->
    <link href="{{ url_for('static',filename='cms/css/signin.css') }}" rel="stylesheet">
</head>
<body>
{#<div class="container">#}
{#    <form class="form-signin" method="post" action="/login">#}
{#        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>#}
{#        <h2 class="form-signin-heading">请登录</h2>#}
{#        <label for="inputEmail" class="sr-only">邮箱：</label>#}
{#        <input type="email" id="inputEmail" class="form-control" placeholder="邮箱" required autofocus/>#}
{#        <label for="inputPassword" class="sr-only">密吗</label>#}
{#        <input type="password" id="inputPassword" class="form-control" placeholder="密码" required>#}
{#        <div class="checkbox">#}
{#            <label>#}
{#                <input type="checkbox" value="remember-me"> 记住我#}
{#            </label>#}
{#        </div>#}
{#        <button class="btn btn-lg btn-primary btn-block" type="submit">立即登录</button>#}
{##}
{#    </form>#}
{#    {% if message %}#}
{#        <p style="text-align: center" class="text-danger">{{ message }}</p>#}
{#    {% endif %}#}
{##}
{#</div><!-- /container -->#}
<div class="container">
    <form class="form-signin" method="POST">
        <h2>登录界面</h2>
        {{ form.hidden_tag() }}
        {% if form.email.errors or loginError %}
            <loginout class="input-group  required has-error">
                <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
                {{ form.email(class="form-control",required='required') }}
                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
            </loginout>
            {% if loginError %}
                <div class="form-group has-error">
                    <p class="help-block">{{ loginError }}</p>
                </div>
            {% endif %}
            {% for error in form.email.errors %}
                <div class="form-group has-error">
                    <p class="help-block">{{ error }}</p>
                </div>
            {% endfor %}

        {% else %}
            <div class="input-group">
                <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
                {{ form.email(class="form-control",required='required') }}
            </div>
        {% endif %}

        <div class="input-group">
            <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
            {{ form.password(class="form-control",required='required') }}
        </div>
        <div class="form-group">
{#            <div class="checkbox checkbox-primary" style="display: inline;">#}
                {{ form.remember_me() }}记住密码
{#                <label>#}
{#                    {{ form.remember_me.label.text }}#}
{#                </label>#}
{#            </div>#}
        </div>
        {#
    {{ wtf.form_field(form.remember_me) }}
    #}


        {{ wtf.form_field(form.submit,class="btn btn-success btn-block") }}
    </form>
</div><!-- /container -->
</body>
</html>